
package diffteleop_base;

/**
/*  handles all the publishing to LCM to use diff drive messages to drive individual
 * wheels on the robot
 */
import april.util.TimeUtil;
import lcm.lcm.LCM;
import arlpanda.lcmtypes.difteleop_t;

public class DiffDrive {

    //Members
    private final LCM lcm;

    public DiffDrive(LCM lcm) {
        this.lcm = lcm;
    }

    // TODO test there is more to it to send it across the network
    public void sendLR(double left, double right) {
        difteleop_t cmd = new difteleop_t();
        cmd.left = (float) left;
        cmd.right = (float) right;
        cmd.utime = TimeUtil.utime();
        this.lcm.publish("Team10_TELEOP", cmd);
        System.out.println("Sent");
    }
}
